package com.indexingsystem.system.service.impl;

import javax.annotation.Resource;

import com.alibaba.druid.sql.dialect.postgresql.visitor.PGEvalVisitor;
import com.github.pagehelper.PageHelper;
import com.indexingsystem.boss.Vo.GetAuditTaskListReqVo;
import com.indexingsystem.boss.common.BeanUtil;
import com.indexingsystem.boss.common.PagedResult;
import org.springframework.stereotype.Service;

import com.indexingsystem.boss.admin.mapper.IdxTaskCheckMapper;
import com.indexingsystem.boss.entity.IdxTaskCheck;
import com.indexingsystem.system.service.IdxTaskCheckService;

import java.util.List;

@Service
public class IdxTaskCheckServiceImpl  implements IdxTaskCheckService{
	@Resource
	private IdxTaskCheckMapper idxTaskCheckMapper;
	
	@Override
	public int deleteByPrimaryKey(String checkId) {
		// TODO Auto-generated method stub
		return idxTaskCheckMapper.deleteByPrimaryKey( checkId );
	}

	@Override
	public int insert(IdxTaskCheck record) {
		// TODO Auto-generated method stub
		return idxTaskCheckMapper.insert( record );
	}

	@Override
	public int insertSelective(IdxTaskCheck record) {
		// TODO Auto-generated method stub
		return idxTaskCheckMapper.insertSelective( record );
	}

	@Override
	public IdxTaskCheck selectByPrimaryKey(String checkId) {
		// TODO Auto-generated method stub
		return idxTaskCheckMapper.selectByPrimaryKey( checkId );
	}

	@Override
	public int updateByPrimaryKeySelective(IdxTaskCheck record) {
		// TODO Auto-generated method stub
		return idxTaskCheckMapper.updateByPrimaryKeySelective( record );
	}

	@Override
	public int updateByPrimaryKeyWithBLOBs(IdxTaskCheck record) {
		// TODO Auto-generated method stub
		return idxTaskCheckMapper.updateByPrimaryKey( record );
	}

	@Override
	public int updateByPrimaryKey(IdxTaskCheck record) {
		// TODO Auto-generated method stub
		return idxTaskCheckMapper.updateByPrimaryKey( record );
	}

	@Override
	public int updateStatusByIds(Integer status, List<String> ids) {
		return idxTaskCheckMapper.updateStatusByIds(status,ids);
	}

	@Override
	public PagedResult<IdxTaskCheck> getAuditTaskList(GetAuditTaskListReqVo reqVo) {
		int pageNo = reqVo.getPageNo() == null? 1 : reqVo.getPageNo();
		int pageSize = reqVo.getPageSize() == null ? 20 : reqVo.getPageSize();

        PageHelper.startPage(pageNo, pageSize);
        return BeanUtil.toPagedResult(idxTaskCheckMapper.getAuditTaskList(reqVo));

	}

}
